<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class PushAuthData extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $data = [[
            'name' => 'AdminApi',
            'title' => '后台接口',
            'icon' => '',
            'pid' => '0',
            'type' => '3',
            'check_type' => '1',
        ], [
            'name' => 'AdminApiLogin',
            'title' => '后台登录接口',
            'icon' => '',
            'pid' => '1',
            'type' => '4',
            'check_type' => '2',
        ], [
            'name' => 'AdminApiStatus',
            'title' => '后台登录状态',
            'icon' => '',
            'pid' => '1',
            'type' => '4',
            'check_type' => '1',
        ], [
            'name' => 'admin',
            'title' => '人员管理',
            'icon' => 'i-ic-baseline-account-box',
            'pid' => '0',
            'type' => '1',
            'check_type' => '1',
        ], [
            'name' => 'admin-auth',
            'title' => '权限管理',
            'icon' => 'i-ic-baseline-admin-panel-settings',
            'pid' => '4',
            'type' => '2',
            'check_type' => '2',
        ], [
            'name' => 'admin-list',
            'title' => '人员管理',
            'icon' => 'i-ic-baseline-account-box',
            'pid' => '4',
            'type' => '2',
            'check_type' => '2',
        ], [
            'name' => 'admin-info',
            'title' => '个人信息',
            'icon' => 'i-ic-baseline-account-box',
            'pid' => '4',
            'type' => '2',
            'check_type' => '1',
        ], [
            'name' => 'system',
            'title' => '系统设置',
            'icon' => 'i-ic-baseline-settings-applications',
            'pid' => '0',
            'type' => '1',
            'check_type' => '1',
        ], [
            'name' => 'system-assets',
            'title' => '资源设置',
            'icon' => 'i-ic-baseline-color-lens',
            'pid' => '8',
            'type' => '2',
            'check_type' => '2',
        ],];
        foreach ($data as $datum) {
            $auth = new App\Models\Auth();
            $auth->name = $datum['name'];
            $auth->title = $datum['title'];
            $auth->icon = $datum['icon'];
            $auth->pid = $datum['pid'];
            $auth->type = $datum['type'];
            $auth->check_type = $datum['check_type'];
            $auth->show = 1;
            $auth->status = 1;
            $auth->del = 2;
            $auth->order = 0;
            $auth->save();
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
